package com.example.demo.react;

/**
 * 租赁
 */
public class Rental {

    private Movie movie;

    private int dayRented;

    public Rental(Movie movie, int dayRented) {
        this.movie = movie;
        this.dayRented = dayRented;
    }

    public Movie getMovie() {
        return movie;
    }

    public int getDayRented() {
        return dayRented;
    }

    public double getCharge() {
        return this.movie.getCharge(getDayRented());
    }

    /**
     * 設置積分值
     *
     * @return
     */
    public int getFrequentRenterPoint() {
        //add bonus for a two day new release rental
        return this.movie.price.getFrequentRenterPoint(dayRented);
    }
}
